<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            text-align: center;
        }
        
        div {
            display: none;
        }
    </style>
</head>

<body class="box">
    <input type="checkbox">
    <span>两周内自动登录</span>
    <div>你的密码有风险</div>
</body>
<script>
    //   mouseover  鼠标划入
    // mouseout  鼠标划出
    document.querySelector('span').addEventListener('mouseover', function() {
        document.querySelector("div").style.display = "block"
    })
    document.querySelector('span').addEventListener('mouseout', function(e) {
        document.querySelector("div").style.display = "none"
    })
</script>

</html>